package com.shanzmoo.db.third.entity.vo;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.shanzmoo.db.third.entity.PlatformOrderEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 第三方平台订单分页返回对象
 * @author Gzhao 2021/1/7
 */
@Data
@ApiModel("第三方平台订单分页返回对象")
public class PlatformOrderPageVO implements Serializable {

    private static final long serialVersionUID = 1758L;

    @ApiModelProperty("自增ID")
    private Integer id;

    @ApiModelProperty("第三方平台 1-速卖通")
    private Integer platform;

    @ApiModelProperty("订单号")
    private String orderNo;

    @ApiModelProperty("订单状态：1-待发货 2-已发货 3-已完成 9-已关闭")
    private Integer status;

    @ApiModelProperty("负责人（业务员）")
    private String salesman;

    @ApiModelProperty("买家名称")
    private String purchaser;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm")
    @ApiModelProperty("下单时间")
    private LocalDateTime orderTime;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm")
    @ApiModelProperty("付款时间")
    private LocalDateTime payTime;

    @ApiModelProperty("货币类型：0-人民币 1-美元")
    private Integer currency;

    @ApiModelProperty("商品总金额")
    private BigDecimal goodsAmount;

    @ApiModelProperty("物流运费")
    private BigDecimal freight;

    @ApiModelProperty("实付金额")
    private BigDecimal receiveAmount;

    @ApiModelProperty("优惠券金额")
    private BigDecimal couponAmount;

    @ApiModelProperty("订单备注")
    private String memberRemark;

    @ApiModelProperty("收货人")
    private String consignee;

    @ApiModelProperty("收货国家")
    private String receiveNation;

    @ApiModelProperty("收货州/省")
    private String receiveProvince;

    @ApiModelProperty("收货城市")
    private String receiveCity;

    @ApiModelProperty("收货地址")
    private String receiveAddress;

    @ApiModelProperty("邮编")
    private String zipCode;

    @ApiModelProperty("联系方式")
    private String contactWay;

    @ApiModelProperty("买家选择物流")
    private String purchaserLogistics;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm")
    @ApiModelProperty("发货期限")
    private LocalDateTime deliveryEndTime;

    @ApiModelProperty("商品信息")
    private String goodsInfo;

    @ApiModelProperty("第三方平台商品编码")
    private String platformCode;

    @ApiModelProperty("商品编码")
    private String sku;

    @ApiModelProperty("商品数量")
    private String skuNum;

    @ApiModelProperty("实际发货物流公司")
    private String logisticsType;

    @ApiModelProperty("实际发货物流单号")
    private String logisticsNo;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm")
    @ApiModelProperty("发货时间")
    private LocalDateTime deliveryTime;

    @ApiModelProperty("卖家留言")
    private String sellerRemark;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm")
    @ApiModelProperty("导入系统时间")
    private LocalDateTime createTime;

    public static PlatformOrderPageVO create(PlatformOrderEntity platformOrderEntity) {
        return JSON.parseObject(JSON.toJSONString(platformOrderEntity), PlatformOrderPageVO.class);
    }
}
